<template>
  <el-form ref="formRef" :model="formModel" :rules="rules" label-width="120px" class="dialog-form" label-position="right" status-icon>
    <el-form-item label="车牌号:" prop="carNumber">
      <el-input v-model.trim="formModel.carNumber" class="input-item" clearable></el-input>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  props: {
    initData: {
      type: Object,
      default() {
        return {}
      }
    }
  },
  data() {
    return {
      rules: {
        carNumber: [{ required: true, message: '请输入车牌号', trigger: 'input' }]
      }
    }
  },
  computed: {
    formModel: {
      get() {
        return this.initData
      },
      set(val) {
        this.$emit('update:init-data', val)
      }
    }
  }
}
</script>
